import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:meiyunapp/common/font_style.dart';

class TabWidget extends StatelessWidget {
  late String _assetsPath;
  late String _title;
  VoidCallback? _voidCallback;

  TabWidget({required String assetsPath, required String title,VoidCallback? voidCallback, Key? key})
      : super(key: key) {
    _assetsPath = assetsPath;
    _title = title;
    _voidCallback = voidCallback;
  }

  @override
  Widget build(BuildContext context) {
    return InkWell(
      highlightColor: Colors.transparent,
      borderRadius: BorderRadius.circular(10),
      onTap: (){
        _voidCallback?.call();
      },
      child: SizedBox(
        child: Column(
          children: [
            SizedBox(
              width: 26,
              height: 26,
              child: SvgPicture.asset(
                _assetsPath,
              ),
            ),
            const SizedBox(height: 2,),
            Text(
              _title,
              style: AppFontStyles.style1,
            )
          ],
        ),
      ),
    );
  }
}
